var browserify = require('browserify');
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var rename = require("gulp-rename");

gulp.task('dist', function () {
    return browserify('./javascripts/main.js')
        .bundle()
        .pipe(source('freedo.js'))
        .pipe(buffer())
        //.pipe(uglify()) 
        .pipe(rename("main.min.js"))
        .pipe(gulp.dest('./javascripts'));
});